package com.nova.edc.model.energy;

import java.util.Date;

import com.nova.edc.model.system.AreaPoint;
import com.nova.edc.model.system.CollectAreaItem;
import com.nova.edc.model.system.CollectAreaItemAir;
import com.nova.edc.model.system.CustomerArea;
import com.nova.frame.annotation.Id;
import com.nova.frame.annotation.Table;
import com.nova.frame.annotation.Transient;

@Table("t_collectdata")
public class CollectData {
	@Id
	private Integer id;
	private Integer companycode;
	private String gatewayid;
	private Integer sensorid;
	private Integer channelid;
	private Date activetime;
	private String activestate;
	private Integer activecount;
	private String addby;
	private Date adddate;
	@Transient
	private Integer useminute;
	private Integer pointid;
	private Integer areaid;

	public Integer getPointid() {
		return pointid;
	}

	public void setPointid(Integer pointid) {
		this.pointid = pointid;
	}

	public Integer getAreaid() {
		return areaid;
	}

	public void setAreaid(Integer areaid) {
		this.areaid = areaid;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getCompanycode() {
		return companycode;
	}

	public void setCompanycode(Integer companycode) {
		this.companycode = companycode;
	}

	public String getGatewayid() {
		return gatewayid;
	}

	public void setGatewayid(String gatewayid) {
		this.gatewayid = gatewayid;
	}

	public Integer getSensorid() {
		return sensorid;
	}

	public void setSensorid(Integer sensorid) {
		this.sensorid = sensorid;
	}

	public Integer getChannelid() {
		return channelid;
	}

	public void setChannelid(Integer channelid) {
		this.channelid = channelid;
	}

	public Date getActivetime() {
		return activetime;
	}

	public void setActivetime(Date activetime) {
		this.activetime = activetime;
	}

	public String getActivestate() {
		return activestate;
	}

	public void setActivestate(String activestate) {
		this.activestate = activestate;
	}

	public Integer getActivecount() {
		return activecount;
	}

	public void setActivecount(Integer activecount) {
		this.activecount = activecount;
	}

	public String getAddby() {
		return addby;
	}

	public void setAddby(String addby) {
		this.addby = addby;
	}

	public Date getAdddate() {
		return adddate;
	}

	public void setAdddate(Date adddate) {
		this.adddate = adddate;
	}

	public Integer getUseminute() {
		return useminute;
	}

	public void setUseminute(Integer useminute) {
		this.useminute = useminute;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof CollectAreaItem) {
			CollectAreaItem temp = (CollectAreaItem) obj;
			return temp.getGatewayid().equals(this.getGatewayid())
					&& (temp.getChannelid().equals(this.getChannelid()))
					&& (temp.getSensorid().equals(this.getSensorid()));
		} else if (obj instanceof CollectData) {
			CollectData temp = (CollectData) obj;
			return temp.getGatewayid().equals(this.getGatewayid())
					&& (temp.getChannelid().equals(this.getChannelid()))
					&& (temp.getSensorid().equals(this.getSensorid()));
		} else if(obj instanceof CollectAreaItemAir){
			CollectAreaItemAir temp=(CollectAreaItemAir) obj;
			return temp.getGatewayid().equals(this.getGatewayid())
					&& (temp.getChannelid().equals(this.getChannelid()))
					&& (temp.getSensorid().equals(this.getSensorid()));
		} else if(obj instanceof AreaPoint){
			AreaPoint temp=(AreaPoint) obj;
			return temp.getGatewayid().equals(this.getGatewayid())
					&& (temp.getChannelid().equals(this.getChannelid()))
					&& (temp.getSensorid().equals(this.getSensorid()));
		}
		else {
			return false;
		}

	}
}
